/**
 * @author oxchains
 * @time 2018-08-30 14:13
 * @name User
 * @desc:
 */
public class User implements Observer {
    private String name;
    private String message;

    public User(String name) {
        this.name = name;
    }

    public void update(String message) {
        this.message = message;
        read();
    }

    public void read(){
        System.out.println(name + " 收到消息: " + message);
    }

}
